package com.ormlite.pojo;

import java.util.Date;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName = "event")
public class Event {

	@DatabaseField(generatedId = true, index = true)
	private int id;
	@DatabaseField(canBeNull = false)
	private String name;
	@DatabaseField(foreign = true, canBeNull = false, foreignAutoRefresh = true)
	private Movie movie;
	@DatabaseField
	private Date time;
	@DatabaseField(defaultValue = "noComment")
	private String comment;

	public Event() {
		// ORMLite needs a no-arg constructor
	}

	public Event(String name, Movie movie, Date time, String comment) {
		this.name = name;
		this.movie = movie;
		this.time = time;
		this.comment = comment;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Movie getMovie() {
		return movie;
	}

	public void setMovie(Movie movie) {
		this.movie = movie;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}
}